<template>
<div id="train">
  <div id="trainIndex">
    <el-breadcrumb separator=">">
      <el-breadcrumb-item :to="{ path: '/' }">系统首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/train' }">干部培训</el-breadcrumb-item>
      <el-breadcrumb-item>批次详情</el-breadcrumb-item>
    </el-breadcrumb>
    <section class="wboxs" style="height:60px">
      <div style="float:right;" v-if="userType===1">
      <el-button v-if="batch.status===1" type="success" @click="handleAdd" icon="el-icon-plus" style="margin:10px 0;color:#fff">新建班次</el-button>
      <el-button v-if="userType===1" type="info" @click="handleExport" icon="el-icon-download" style="margin:10px 0;color:#fff !important">导出参训人选</el-button>
      <el-button v-if="batch.status===1" type="primary" @click="handleFiled" icon="el-icon-folder-checked" style="margin:10px 0;color:#fff" :loading="btnLoading">一键归档</el-button>
      </div>
      <div style="float:left;margin:10px 10px 0;height:40px;overflow:hidden">
        <el-form :inline="true" :model="filters">
          <div style="height:50px;overflow:hidden">
            <el-form-item label="批次名称："><b>{{batch.batchName}}</b>
            </el-form-item>
            <el-form-item label="创建时间："><b>{{dateFtt('yyyy-MM-dd',batch.dataCreateDatetime)}}</b>
            </el-form-item>
            <el-form-item label="当前批次状态：">
              <i v-if="batch.status===5" class="el-icon-s-claim" style="color:green" />
              <i v-else class="el-icon-s-promotion" :style="batch.status===userType?'color:blue':''" />
              <span v-if="batch.status===5" style="color:green;font-weight:bolder;width:200px;display:inline-block">已归档</span>
              <span v-else :style="batch.status===userType?'color:blue;font-weight:bolder;width:200px;display:inline-block':'width:800px;display:inline-block'">
                {{batch.status===1?"培训处":''}}
                {{batch.status===2?"干部处":''}}
                {{batch.status===3?"分管副司长":''}}
                {{batch.status===4?"司长":''}}
                <span v-if="userType===1&&batch.status===2&&batch.acceptUsers&&batch.acceptUsers.length>0">
                  （{{batch.acceptUsers.map(item=>item.untiname+"："+item.truename).join("、")}}）
                </span>
              </span>
            </el-form-item>
          </div>
        </el-form>
      </div>
    </section>
    <section class="wboxd" :style="'margin-top:10px;height:'+tableHeight+'px'">
      <el-scrollbar style="height: calc(100% + 16px);width:100%;">
        <el-table :data="classList" highlight-current-row class="mytable" v-loading="listLoading" style="width: 100%;" border v-show="viewtype===1">
          <el-table-column type="index" label="序号" width="50" align="center">
          </el-table-column>
          <el-table-column prop="className" label="参训班次" min-width="130">
          </el-table-column>
          <el-table-column label="附件" prop="files" width="70" align="center">
            <template slot-scope="scope">
              <template v-if="scope.row.files&&scope.row.files.length>0">
                <el-popover
                  placement="bottom"
                  trigger="hover">
                  <template>
                    <el-table :data="scope.row.files" class="el-table">
                      <el-table-column prop="fileName" label="附件列表" show-overflow-tooltip width="500">
                        <template slot-scope="scope">
                          <a :href="$http.defaults.baseURL+$http.defaults.trainingAPI+'api/trainingGenFileInfo/download?id='+scope.row.id">{{scope.row.parentName?scope.row.parentName+'('+scope.row.fileName+')':scope.row.fileName}}{{scope.row.fileType?'.'+scope.row.fileType:''}}</a>
                        </template>
                      </el-table-column>
                    </el-table>
                  </template>
                  <div class="myFiles" slot="reference" />
                </el-popover>
              </template>
            </template>
          </el-table-column>
          <el-table-column prop="className" label="当前操作人员" width="110" align="center">
            <template slot-scope="scope">
              <span v-if="batch.status===5" style="color:green;font-weight:bolder">已归档</span>
              <template v-else-if="batch.status===2">
                <template v-if="!scope.row.departments||!scope.row.departments.length===0">
                  <span :style="userType===1?'color:blue;font-weight:bolder':''">培训处</span>
                </template>
                <template v-else>
                  <span :style="userType===2?'color:blue;font-weight:bolder':''">干部处</span>
                </template>
              </template>
              <span v-else :style="batch.status===userType?'color:blue;font-weight:bolder':''">
                {{batch.status===1?"培训处":''}}
                {{batch.status===3?"分管副司长":''}}
                {{batch.status===4?"司长":''}}
              </span>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="content" label="培训内容" width="120" align="center">
          </el-table-column>
          <el-table-column prop="cond" label="条件" width="140" align="center">
          </el-table-column> -->
          <el-table-column prop="startDate" label="班次时间" width="210" align="center">
            <template slot-scope="scope">
              {{scope.row.startDate}} 至 {{scope.row.endDate}}
            </template>
          </el-table-column>
          <!-- <el-table-column prop="duration" label="时长" width="60" align="center">
          </el-table-column> -->
          <el-table-column prop="departments" label="涉及处室" width="250" align="center" v-if="userType!==2">
            <template slot-scope="scope">
              <template v-if="scope.row.departments">
                <template v-for="(item,index) in scope.row.departments.split(',')">
                  <el-tag :key="scope.row.id+'_'+index" v-if="item==='1'">干部一处</el-tag>
                  <el-tag :key="scope.row.id+'_'+index" v-if="item==='2'">干部二处</el-tag>
                  <el-tag :key="scope.row.id+'_'+index" v-if="item==='3'">干部三处</el-tag>
                </template>
              </template>
            </template>
          </el-table-column>
          <el-table-column label="人选建议" header-align="center" v-if="userType!==2">
            <el-table-column prop="persons1" label="干部一处" width="160" header-align="center">
              <template slot-scope="scope">
                <template v-if="scope.row.departments&&scope.row.departments.split(',').indexOf('1')>-1">
                  <el-tooltip v-if="deptConfirm1&&scope.row.recommendedCandidateList.filter(item => item.deptId === 1).length>0" class="item" effect="dark" content="干部一处人选建议已确认" placement="top">
                    <i class="el-icon-success" style="float:left;margin:3px;color:green" />
                  </el-tooltip>
                  <candidates type="recommended" :deptId="1" :classId="scope.row.id" :candidateList="scope.row.recommendedCandidateList" :canEdit="recommendedCanEdit" @reloadBatch="getBatch"></candidates>
                </template>
                <template v-else>—</template>
              </template>
            </el-table-column>
            <el-table-column prop="persons2" label="干部二处" width="160" header-align="center">
              <template slot-scope="scope">
                <template v-if="scope.row.departments&&scope.row.departments.split(',').indexOf('2')>-1">
                  <el-tooltip v-if="deptConfirm2&&scope.row.recommendedCandidateList.filter(item => item.deptId === 2).length>0" class="item" effect="dark" content="干部二处人选建议已确认" placement="top">
                    <i class="el-icon-success" style="float:left;margin:3px;color:green" />
                  </el-tooltip>
                  <candidates type="recommended" :deptId="2" :classId="scope.row.id" :candidateList="scope.row.recommendedCandidateList" :canEdit="recommendedCanEdit" @reloadBatch="getBatch"></candidates>
                </template>
                <template v-else>—</template>
              </template>
            </el-table-column>
            <el-table-column prop="persons3" label="干部三处" width="160" header-align="center">
              <template slot-scope="scope">
                <template v-if="scope.row.departments&&scope.row.departments.split(',').indexOf('3')>-1">
                  <el-tooltip v-if="deptConfirm3&&scope.row.recommendedCandidateList.filter(item => item.deptId === 3).length>0" class="item" effect="dark" content="干部三处人选建议已确认" placement="top">
                    <i class="el-icon-success" style="float:left;margin:3px;color:green" />
                  </el-tooltip>
                  <candidates type="recommended" :deptId="3" :classId="scope.row.id" :candidateList="scope.row.recommendedCandidateList" :canEdit="recommendedCanEdit" @reloadBatch="getBatch"></candidates>
                </template>
                <template v-else>—</template>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column v-else :label="'干部'+deptIdName+'处人选建议'" header-align="center" :prop="'persons'+deptId" width="400">
            <template slot-scope="scope">
              <template v-if="scope.row.departments&&scope.row.departments.split(',').indexOf(deptId.toString())>-1">
                <candidates type="recommended" :deptId="deptId" :classId="scope.row.id" :candidateList="scope.row.recommendedCandidateList" :canEdit="recommendedCanEdit" @reloadBatch="getBatch"></candidates>
              </template>
              <template v-else>—</template>
            </template>
          </el-table-column>
          <el-table-column prop="persons" header-align="center" label="参训人选" width="250" v-if="userType!==2">
            <template slot-scope="scope">
              <candidates type="official" :cond="scope.row.cond" :personNumber="scope.row.personNumber" :classId="scope.row.id" :candidateList="scope.row.officialCandidateList" :canEdit="((!scope.row.departments||!scope.row.departments.length===0)&&userType===1&&batch.status===2)||officialCanEdit" @reloadBatch="getBatch"></candidates>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="remark" label="备注" width="60" align="center">
          </el-table-column> -->
          <el-table-column label="操作" width="150">
            <template slot-scope="scope">
              <div ref="EditBtns" style="padding:10px 0;min-height:55px;">
                <!-- <el-button size="small" @click="handleDetail(scope.row.id)" :loading="btnLoading" style="margin:10px 0 10px 0">查看</el-button>
                <el-dropdown v-if="userType===1&&batch.status===1" style="margin-left:5px">
                  <span class="el-dropdown-link">
                    更多<i class="el-icon-arrow-down el-icon--right"></i>
                  </span>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="handleEdit(scope.row.id)" >修改</el-dropdown-item>
                    <el-dropdown-item v-if="scope.row.recommendedCandidateList.length===0&&scope.row.officialCandidateList.length===0" @click.native="handleDel(scope.row.id)" >删除</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown> -->
                <el-dropdown split-button  @click="handleDetail(scope.row.id)" size="small" v-if="userType===1&&batch.status===1">
                  查看
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="handleEdit(scope.row.id)" >修改</el-dropdown-item>
                    <el-dropdown-item v-if="scope.row.recommendedCandidateList.length===0&&scope.row.officialCandidateList.length===0" @click.native="handleDel(scope.row.id)" >删除</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
                <el-button size="small" v-else @click="handleDetail(scope.row.id)" style="margin:10px 0 10px 0">查看</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <!-- <el-divider /> -->
        <div style="margin:20px;">
          <h1>意见</h1>
          <div v-if="!batch.flowList||!batch.flowList.length" style="margin:20px;">暂无意见信息</div>
          <ul v-else>
            <li v-for="item of batch.flowList" :key="item.id" style="padding:10px"><b>{{item.sendUserName}} [{{item.sendTime}}]：</b>{{item.opinion}}</li>
          </ul>
          <template v-if="userType===batch.status">
            <h1>流转</h1>
            <div v-if="userType===1&&batch.status===1">
              <el-radio-group v-model="sendUserType">
                <div style="margin:10px 20px;" v-if="sendToDept">
                  <el-radio :label="2">请干部处建议人选</el-radio>
                  <el-select v-if="dept1show" v-model="flowForm.user1" placeholder="请选择干部一处人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list1" :key="'user21_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                  <el-select v-if="dept2show" v-model="flowForm.user2" placeholder="请选择干部二处人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list2" :key="'user22_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                  <el-select v-if="dept3show" v-model="flowForm.user3" placeholder="请选择干部三处人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list3" :key="'user23_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                </div>
                <div style="margin:10px 20px 0;">
                  <el-radio :label="3">请分管副司长确认人选</el-radio>
                  <!-- <el-select v-model="flowForm.leader" placeholder="请选择分管副司长" style="width:180px;">
                    <el-option v-for="(item,index) in user3list" :key="'user3_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select> -->
                </div>
              </el-radio-group>
            </div>
            <div v-if="userType===2&&batch.status===2" style="margin:20px 20px 10px;font-weight:bolder">

              <el-radio-group v-model="sendUserType">
                <div style="margin:10px 20px;">
                  <el-radio :label="2">交由本处室其他人员处理</el-radio>
                  <el-select v-if="myUnit==='干部一处'" v-model="flowForm.user1" placeholder="请选择人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list1" :key="'user21_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                  <el-select v-if="myUnit==='干部二处'" v-model="flowForm.user2" placeholder="请选择人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list2" :key="'user22_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                  <el-select v-if="myUnit==='干部三处'" v-model="flowForm.user3" placeholder="请选择人员" style="width:180px;margin-right:10px">
                    <el-option label="未选择" :value="null"></el-option>
                    <el-option v-for="(item,index) in user2list3" :key="'user23_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select>
                </div>
                <div style="margin:10px 20px 0;">
                  <el-radio :label="1">将推荐人选提交至培训处</el-radio>
                </div>
              </el-radio-group>
            </div>
            <div v-if="userType===3&&batch.status===3">
              <el-radio-group v-model="sendUserType">
                <div style="margin:20px 20px 0;">
                  <el-radio :label="1">确认人选并发往培训处</el-radio><br /><br />
                  <el-radio style="clear:both;margin-top:10px" :label="4">请司长确认人选</el-radio>
                </div>
              </el-radio-group>
            </div>
            <div v-if="userType===4&&batch.status===4">
              <el-radio-group v-model="sendUserType">
                <div style="margin:20px 20px 0;">
                  <el-radio :label="1">确认人选并发往培训处</el-radio><br /><br />
                  <el-radio style="clear:both;margin-top:10px" :label="3">流转至分管副司长</el-radio>
                  <!-- <el-select v-model="flowForm.leader" placeholder="请选择分管副司长" style="width:180px;">
                    <el-option v-for="(item,index) in user3list" :key="'user3_'+index" :label="item.truename" :value="item.id"></el-option>
                  </el-select> -->
                </div>
              </el-radio-group>
            </div>
            <div style="margin:10px 40px 10px 20px;">
              <el-autocomplete :trigger-on-focus="false" :fetch-suggestions="querySearch" v-model="opinion" style="width:80%" :maxlength="200" placeholder="请填写意见" />
              <el-popover
                placement="top"
                width="300"
                trigger="click"
                v-model="visible">
                <div class="pop-item" v-for="(item, idx) of opinionList" :key="idx" @click="opinion = item ; visible = !visible">{{item}}</div>
                <el-button type="primary" slot="reference" v-show="opinionList&&opinionList.length>0">常用意见库</el-button>
              </el-popover>
              <el-button type="success" @click="flowSubmit" :loading="opinionLoading">发送</el-button>
            </div>
          </template>
        </div>
      </el-scrollbar>
      <!--新增界面-->
      <el-dialog :title="addFormTitle" :visible.sync="addFormVisible" width="98%" top="20px" :close-on-click-modal="false" :close-on-press-escape="false" >
        <div v-if="dataLoading">数据加载中...</div>
        <div id="batchEditTable" v-else>
          <el-form :model="addForm" :rules="addFormRules" ref="addForm" >
            <table cellspacing="0" cellpadding="0" class="mytable">
              <tr>
                <th>班次名称</th>
                <td>
                  <el-form-item label="" prop="className">
                    <el-input v-model="addForm.className" style="width:300px;" :maxlength="50"></el-input>
                  </el-form-item>
                </td>
                <th>举办单位</th>
                <td>
                  <el-form-item label="" prop="trainUnit">
                    <el-input v-model="addForm.trainUnit" style="width:300px;" :maxlength="50"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <th>培训内容</th>
                <td>
                  <el-form-item label="" prop="content">
                    <el-input v-model="addForm.content" style="width:300px;" :maxlength="200"></el-input>
                  </el-form-item>
                </td>
                <th>条件</th>
                <td>
                  <el-form-item label="" prop="cond">
                    <el-input v-model="addForm.cond" style="width:300px;" :maxlength="100"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <th>班次时间</th>
                <td>
                  <el-form-item label="" prop="startDate">
                    <el-date-picker :clearable="false" v-model="addForm.startDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="setDuration" />
                  </el-form-item>
                </td>
                <th>时长</th>
                <td>
                  <el-form-item label="" prop="duration">
                    <template v-if="addForm.duration">{{addForm.duration}}天</template>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <th>参训地点</th>
                <td>
                  <el-form-item label="" prop="place">
                    <el-input v-model="addForm.place" auto-complete="off" style="width:300px;" :maxlength="50"></el-input>
                  </el-form-item>
                </td>
                <th>涉及处室</th>
                <td>
                  <el-form-item label="" prop="departments">
                    <el-select v-model="addForm.departments" multiple placeholder="请选择" style="width:300px;">
                      <el-option label="干部一处" :value="1"></el-option>
                      <el-option label="干部二处" :value="2"></el-option>
                      <el-option label="干部三处" :value="3"></el-option>
                    </el-select>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <th>培训人数</th>
                <td >
                  <el-form-item label="" prop="personNumber">
                    <el-input-number v-model="addForm.personNumber" :min="1" :step="1" step-strictly />
                  </el-form-item>
                </td>
                <th>备注</th>
                <td>
                  <el-form-item label="" prop="remarks">
                    <el-input v-model="addForm.remarks" auto-complete="off" style="width:300px;" :maxlength="500"></el-input>
                  </el-form-item>
                </td>
              </tr>
              <tr>
                <th>附件</th>
                <td colspan="3">
                  <section style="margin-bottom:10px;">
                    <el-button-group style="margin:10px">
                      <el-button type="primary" icon="el-icon-arrow-up" :loading="btnLoading" @click="moveData(-1)" :disabled="!moveUpFlag">上移</el-button>
                      <el-button type="primary" icon="el-icon-arrow-down" :loading="btnLoading" @click="moveData(1)" :disabled="!moveDownFlag">下移</el-button>
                    </el-button-group>
                    <el-table :data="files" highlight-current-row style="width: 100%;" border @selection-change="handleSelectionChange" ref="multipleTable">
                      <el-table-column type="selection" width="40" />
                      <el-table-column prop="fileName" label="文件名" show-overflow-tooltip>
                        <template slot-scope="scope">
                          {{scope.row.fileName}}{{scope.row.fileType?'.'+scope.row.fileType:''}}
                        </template>
                      </el-table-column>
                      <el-table-column label="操作" width="100">
                        <template slot-scope="scope">
                          <el-popconfirm title="确定删除该信息吗？" style="margin-left:10px;" @confirm="removeFile(scope.row.id)">
                            <el-button slot="reference" size="small" type="text" icon="el-icon-delete">删除</el-button>
                          </el-popconfirm>
                        </template>
                      </el-table-column>
                    </el-table>
                  </section>
                  <el-upload
                    class="upload-demo"
                    ref="upload"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.trainingAPI +'api/trainingGenFileInfo/upload/'"
                    :on-success="handleUploadSucc"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="false"
                    :file-list="fileList"
                    :show-file-list="false"
                    :on-preview="handlePreview"
                    :before-upload="beforeUpload"
                  >
                    <el-button type="primary">点击上传</el-button>
                  </el-upload>
                </td>
              </tr>
            </table>
          </el-form>
          <el-button type="primary" style="margin-left:10px" :loading="addLoading" @click="submitForm">保存</el-button>
        </div>
      </el-dialog>
      <!--修改界面-->
      <el-dialog title="查看班次" :visible.sync="editFormVisible" width="98%" top="20px" :close-on-click-modal="false" :close-on-press-escape="false" >
        <div>
          <class-detail :id="classId" :showPerson="userType!==2" :timestamp="timestamp" />
        </div>
      </el-dialog>
    </section>
  </div>
</div>
</template>

<script>
import candidates from './candidates'
import classDetail from './classDetail.vue'
export default {
  components: {
    candidates,
    classDetail
  },
  data () {
    return {
      fileList: [],
      files: [],
      moveUpFlag: false,
      moveDownFlag: false,
      timestamp: null,
      deptConfirm1: false,
      deptConfirm2: false,
      deptConfirm3: false,
      sendToDept: false,
      visible: false,
      opinionList: [],
      flowForm: {
        user1: null,
        user2: null,
        user3: null,
        leader: null
      },
      user1list: [],
      user4list: [],
      user2list1: [],
      user2list2: [],
      user2list3: [],
      user3list: [],
      classId: null,
      dataLoading: false,
      classList: [],
      yearlist: [],
      opinionLoading: false,
      opinion: '',
      userType: '',
      deptId: 0,
      deptIdName: '',
      officialCanEdit: false,
      recommendedCanEdit: false,
      batch: {},
      activeName: 'formal',
      personVisible: false,
      sendUserType: null,
      viewtype: 1,
      filters: {},
      btnLoading: false,
      tableHeight: 200,
      maxId: 0,
      isAdmin: true, // 临时调整为true
      isChuzhang: false,
      listLoading: false,
      totalnum: 0,
      addFormVisible: false, // 新增界面是否显示
      addFormTitle: '新建班次',
      addLoading: false,
      // 新增界面数据
      addForm: {
        className: '',
        trainUnit: '',
        content: '',
        cond: '',
        startDate: [],
        duration: '',
        place: '',
        departments: '',
        personNumber: '',
        remarks: ''
      },
      addFormRules: {
        className: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        trainUnit: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        content: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        cond: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        startDate: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        duration: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        place: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        personNumber: [
          { required: true, message: '必填项', trigger: 'blur' }
        ]
      },
      editFormRules: {
        Name: [
          { required: true, message: '必填项', trigger: 'blur' }
        ],
        TheYear: [
          { required: true, message: '必填项', trigger: 'blur' }
        ]
      },
      editFormVisible: false, // 编辑界面是否显示
      editLoading: false,
      // 编辑界面数据
      editForm: {
        Name: '',
        TheYear: '',
        Id: 0
      }
    }
  },
  watch: {
    batch: {
      handler (val) {
        this.deptConfirm()
      },
      immediate: true
    },
    user2list1: {
      handler (val) {
        this.deptConfirm()
      },
      immediate: true
    },
    user2list2: {
      handler (val) {
        this.deptConfirm()
      },
      immediate: true
    },
    user2list3: {
      handler (val) {
        this.deptConfirm()
      },
      immediate: true
    }
  },
  methods: {
    handleExport () {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.trainingAPI + 'api/trainingBusFiledCandidate/getExportByBatch?batchId=' + this.$route.params.id)
    },
    handleSelectionChange (val) {
      this.moveUpFlag = false
      this.moveDownFlag = false
      this.multipleSelection = val
      if (this.multipleSelection.length === 1) {
        this.moveUpFlag = true
        this.moveDownFlag = true
        if (this.files.findIndex(item => item.id === this.multipleSelection[0].id) === 0) {
          this.moveUpFlag = false
        }
        if (this.files.findIndex(item => item.id === this.multipleSelection[0].id) === this.files.length - 1) {
          this.moveDownFlag = false
        }
      }
    },
    moveData (flag) {
      let index = this.files.findIndex(item => item.id === this.multipleSelection[0].id)
      let newItem = this.files[index]
      this.$set(this.files, index, this.files[index + flag])
      this.$set(this.files, index + flag, newItem)
      this.$nextTick(() => {
        let id = this.multipleSelection[0].id
        this.moveUpFlag = true
        this.moveDownFlag = true
        if (this.files.findIndex(item => item.id === id) === 0) {
          this.moveUpFlag = false
        }
        if (this.files.findIndex(item => item.id === id) === this.files.length - 1) {
          this.moveDownFlag = false
        }
      })
    },
    beforeUpload (file) {
      console.log('文件大小')
      console.log(file.size)
      // const isFormat = file.name.indexOf('.dwtb') > 0
      const isLt5M = file.size / 1024 / 1024 < 500
      if (!isLt5M) {
        this.$message.error('上传文件大小不能超过 500MB!')
      } else {
        this.addLoading = true
      }
      console.log(isLt5M)
      return isLt5M
    },
    formatFiles (files) {
      if (files && files.length > 0) {
        const newfiles = []
        for (let i = 0; i < files.length; i++) {
          newfiles.push({ name: files[i].fileName + '.' + files[i].fileType, id: files[i].id })
        }
        console.log(newfiles)
        return newfiles
      }
    },
    formatSuccList (fileList) {
      if (fileList && fileList.length > 0) {
        const newfiles = []
        let i = fileList.length - 1
        if (fileList[i].response) {
          newfiles.push({ name: fileList[i].response.result[0].fileName + '.' + fileList[i].response.result[0].fileType, id: fileList[i].response.result[0].id })
        } else {
          newfiles.push(fileList[i])
        }
        console.log(newfiles)
        return newfiles
      }
    },
    removeFile (id) {
      this.$refs.multipleTable.clearSelection()
      console.log('删除：' + id)
      this.files.splice(this.files.findIndex(item => item.id === id), 1)
      this.removeFileIds.push(id)
      // this.files.splice
    },
    handleUploadSucc (response, file, fileList) {
      this.addLoading = false
      if (response.success) {
        this.$refs.multipleTable.clearSelection()
        this.files.push({id: response.result[0].id, fileName: response.result[0].fileName, fileType: response.result[0].fileType, fileAuth: 1})
        // this.fileList = this.formatSuccList(fileList)
        this.$message({
          message: '上传成功！' + response.message,
          type: 'success'
        })
      } else {
        this.$message({
          message: '上传失败:' + response.message,
          type: 'error'
        })
      }
    },
    beforeRemove (file, fileList) {
      if (file && file.status === 'success') {
        return this.$confirm(`确定删除 ${file.name}？`)
      }
    },
    handleRemove (file, fileList) {
      if (file && file.status === 'success') {
        console.log(file, fileList)
        const fid = file.id
        const url = 'trainingGenFileInfo/remove'
        let para = {
          params: {
            id: fid
          }
        }
        this.$http.get(this.$http.defaults.trainingAPI + url, para).then(res => {
          console.log('删除成功:', res)
          if (res.data.success === true) {
            this.$refs.multipleTable.clearSelection()
            const newfiles = []
            for (let i = 0; i < this.files.length; i++) {
              if (this.files[i].id !== fid) {
                newfiles.push(this.files[i])
              }
            }
            this.files = newfiles
            // this.fileList = this.formatFiles(this.files)
            this.$message({
              message: '删除成功！',
              type: 'success'
            })
          }
        })
      }
    },
    uploadError (err) {
      this.addLoading = false
      console.log(err)
      this.$message({
        message: '上传失败:' + err,
        type: 'error'
      })
    },
    download (id) {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.trainingAPI + 'api/trainingGenFileInfo/download?id=' + id)
    },
    handlePreview (file) {
      if (window.navigator.msSaveOrOpenBlob) {
        navigator.msSaveBlob(this.$http.defaults.baseURL + this.$http.defaults.trainingAPI + 'api/trainingGenFileInfo/download?id=' + file.id, file.name)
      } else {
        var link = document.createElement('a')
        link.download = file.name
        link.href = this.$http.defaults.baseURL + this.$http.defaults.trainingAPI + 'api/trainingGenFileInfo/download?id=' + file.id
        link.click()
        console.log(this.$http.defaults.trainingAPI + 'api/trainingGenFileInfo/download?id=' + file.id)
        window.URL.revokeObjectURL(link.href)
      }
    },
    GetNumberOfDays (date1, date2) { // 获得天数
    // date1：开始日期，date2结束日期
      var a1 = Date.parse(new Date(date1))
      var a2 = Date.parse(new Date(date2))
      var day = parseInt((a2 - a1) / (1000 * 60 * 60 * 24))// 核心：时间戳相减，然后除以天数
      return day
    },
    setDuration () {
      this.addForm.duration = this.GetNumberOfDays(this.addForm.startDate[0], this.addForm.startDate[1]) + 1
    },
    querySearch (queryString, cb) {
      return this.getNotice(this, queryString, cb)
    },
    getNotice (self, queryString, cb) {
      let para = {
        key: queryString
      }
      self.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusFlow/getTopOpinions`, para)
        .then(function (response) {
          console.log('获取成功')
          var results = response.data.result
          let newArr = []
          results.forEach(function (item) {
            let obj = {'value': item}
            newArr.push(obj)
          })
          cb(newArr)
        })
        .catch((error) => {
          console.log(error)
        })
    },
    getOpinionList () {
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusFlow/getTopOpinions`, {})
        .then(response => {
          if (response.data.success) {
            this.opinionList = response.data.result
          } else {
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    flowSubmit () {
      if (this.classList.length === 0) {
        this.$message({
          message: '请先创建班次',
          type: 'error'
        })
        return
      }
      // if (this.batch.status === 2) {
      //   this.sendUserType = 1
      // } else {
      if (!this.sendUserType) {
        this.$message({
          message: '请选择流转接收用户类型',
          type: 'error'
        })
        return
      }
      // }
      let acceptUserIds = []
      if (this.sendUserType === 2) {
        if (this.batch.status === 2) {
          switch (this.myUnit) {
            case '干部一处':
              if (this.flowForm.user1) {
                acceptUserIds.push(this.flowForm.user1)
              }
              break
            case '干部二处':
              if (this.flowForm.user2) {
                acceptUserIds.push(this.flowForm.user2)
              }
              break
            case '干部三处':
              if (this.flowForm.user3) {
                acceptUserIds.push(this.flowForm.user3)
              }
              break
          }
        } else {
          if (this.flowForm.user1) {
            acceptUserIds.push(this.flowForm.user1)
          }
          if (this.flowForm.user2) {
            acceptUserIds.push(this.flowForm.user2)
          }
          if (this.flowForm.user3) {
            acceptUserIds.push(this.flowForm.user3)
          }
        }
      }
      if (this.sendUserType === 3) {
        if (!this.user3list || this.user3list.length === 0) {
          this.$message({
            message: '请先给分管副司长授权干部培训模块管理权限',
            type: 'error'
          })
          return
        }
        acceptUserIds.push(this.user3list[0].id)
      }
      if (this.sendUserType === 1) {
        if (!this.user4list || this.user4list.length === 0) {
          this.$message({
            message: '系统缺少干部培训管理角色的用户',
            type: 'error'
          })
          return
        }
        acceptUserIds.push(this.user1list[0].id)
      }
      if (this.sendUserType === 4) {
        if (!this.user4list || this.user4list.length === 0) {
          this.$message({
            message: '系统缺少司长角色的用户',
            type: 'error'
          })
          return
        }
        acceptUserIds.push(this.user4list[0].id)
      }
      if (acceptUserIds.length === 0) {
        this.$message({
          message: '请选择流转接收用户',
          type: 'error'
        })
        return
      }
      if (!this.opinion) {
        this.$message({
          message: '请填写意见',
          type: 'error'
        })
        return
      }
      let para = {
        acceptUserIds: acceptUserIds,
        batchId: this.$route.params.id,
        opinion: this.opinion,
        status: this.sendUserType,
        beforeStatus: this.batch.status
      }
      console.log(para)
      this.opinionLoading = true
      this.$http.post(this.$http.defaults.trainingAPI + `api/trainingBusFlow/submitFlow`, para).then(response => {
        console.log(response.data.success)
        this.opinionLoading = false
        if (response.data.success === true) {
          this.$message({
            message: '发送成功',
            type: 'success'
          })
          this.opinion = ''
          if (this.userType === 2) {
            this.$router.push({name: `Train`})
          } else {
            this.getBatch()
          }
        } else {
          console.log('发送失败:' + response.data.message)
          this.$message({
            message: '发送失败:' + response.data.message,
            type: 'error'
          })
        }
      }).catch((error) => {
        console.log(error)
        this.$message({
          message: '发送失败:' + error,
          type: 'error'
        })
        this.opinionLoading = false
      })
    },
    handleFiled () {
      this.$confirm('确认将该批次归档吗？归档后该批次全部流程结束', '提示', {
        type: 'warning'
      }).then(() => {
        this.btnLoading = true
        this.$http
          .get(this.$http.defaults.trainingAPI + `api/trainingBusBatch/saveArchive?id=` + this.$route.params.id)
          .then(response => {
            this.btnLoading = false
            if (response.data.success === true) {
              console.log('归档成功')
              this.$message({
                message: '归档成功',
                type: 'success'
              })
              this.getBatch()
            } else {
              console.log('获取失败:' + response.data.message)
              this.$message({
                message: '获取失败:' + response.data.message,
                type: 'error'
              })
            }
          })
          .catch((error) => {
            this.btnLoading = false
            console.log(error)
            this.$message({
              message: '获取失败:' + error,
              type: 'error'
            })
          })
      })
    },
    inRoles (str) {
      let arr = JSON.parse(localStorage.getItem('Roles'))
      if (arr.indexOf(str) === -1) {
        return false
      } else {
        return true
      }
    },
    getAuth () {
      this.$http
        .get(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getCurrentUserAuth`)
        .then(response => {
          if (response.data.success === true) {
            console.log('获取成功')
            this.myAuth = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    handleIndex () {
      this.$router.push({name: `Train`})
    },
    handleAuth () {
      this.$router.push({name: `trainAuth`})
    },
    handleChart () {
      this.$router.push({name: `trainChart`})
    },
    showperson (id) {
      this.mypersonid = id
      console.log('mypersonid:' + this.mypersonid)
      this.showpersonVisible = true
    },
    // 获取用户列表
    getBatch () {
      this.listLoading = true
      // var personParams = { Page: 0, Pagenum: 20, Personname: '', Unitkey: '', Sortkey: '', Isace: true, timestamp: new Date().getTime() }
      this.$http
        .get(this.$http.defaults.trainingAPI + `api/trainingBusBatch/getById?id=` + this.$route.params.id)
        .then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            this.batch = response.data.result
            this.getDeptId()
            this.dept1show = false
            this.dept2show = false
            this.dept3show = false
            this.sendToDept = false
            this.batch.classList.forEach((item, index) => {
              if (item.departments && item.departments.split(',').indexOf('1') > -1) {
                this.dept1show = true
                this.sendToDept = true
              }
              if (item.departments && item.departments.split(',').indexOf('2') > -1) {
                this.dept2show = true
                this.sendToDept = true
              }
              if (item.departments && item.departments.split(',').indexOf('3') > -1) {
                this.dept3show = true
                this.sendToDept = true
              }
            })
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    // 显示新增界面
    handleAdd: function () {
      this.addFormVisible = true
      this.addFormTitle = '新建班次'
      this.addForm = {
        id: null,
        className: '',
        trainUnit: '',
        content: '',
        cond: '',
        startDate: [],
        duration: '',
        place: '',
        departments: '',
        personNumber: '',
        remarks: ''
      }
      this.files = []
    },
    handleEdit (id) {
      this.addFormVisible = true
      this.addFormTitle = '修改班次'
      this.dataLoading = true
      this.addForm = {
        id: null,
        className: '',
        trainUnit: '',
        content: '',
        cond: '',
        startDate: [],
        duration: '',
        place: '',
        departments: '',
        personNumber: '',
        remarks: ''
      }
      this.$http
        .get(this.$http.defaults.trainingAPI + `api/trainingBusClass/getById?id=` + id)
        .then(response => {
          this.dataLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            this.addForm = response.data.result
            this.addForm.departments = this.addForm.departments ? this.addForm.departments.split(',').map(item => parseInt(item)) : null
            this.addForm.startDate = [this.addForm.startDate, this.addForm.endDate]
            this.files = response.data.result.files.map(item => { return {subNames: item.subNames, fileName: item.fileName, parentName: item.parentName, fileType: item.fileType, id: item.id} })
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          this.dataLoading = false
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    // 显示编辑界面
    handleDetail: function (id) {
      this.editFormVisible = true
      this.timestamp = new Date().getTime()
      this.classId = id
    },
    submitForm () {
      this.$refs.addForm.validate((valid) => {
        if (valid) {
          this.addLoading = true
          let para = {
            id: this.addForm.id,
            batchId: this.$route.params.id,
            className: this.addForm.className,
            cond: this.addForm.cond,
            content: this.addForm.content,
            departments: (this.addForm.departments && this.addForm.departments.length) ? this.addForm.departments.join(',') : '',
            duration: this.addForm.duration,
            personNumber: this.addForm.personNumber,
            place: this.addForm.place,
            remarks: this.addForm.remarks,
            startDate: this.addForm.startDate[0],
            endDate: this.addForm.startDate[1],
            trainUnit: this.addForm.trainUnit,
            files: this.files && this.files.length > 0 ? this.files.map(item => item.id) : []
          }
          this.$http.post(this.$http.defaults.trainingAPI + `api/trainingBusClass/save`, para).then(response => {
            console.log(response.data.success)
            if (response.data.success === true) {
              this.$message({
                message: '保存成功',
                type: 'success'
              })
              this.$refs['addForm'].resetFields()
              this.addFormVisible = false
              this.addLoading = false
              this.getBatch()
            } else {
              console.log('保存失败:' + response.data.message)
              this.$message({
                message: '保存失败:' + response.data.message,
                type: 'error'
              })
              this.addLoading = false
            }
          }).catch((error) => {
            console.log(error)
            this.$message({
              message: '保存失败:' + error,
              type: 'error'
            })
            this.addLoading = false
          })
        }
      })
    },
    // 新增
    // 删除
    handleDel: function (id) {
      this.$confirm('确认删除该记录吗?', '提示', {
        type: 'warning'
      }).then(() => {
        let para = {ids: [id]}
        this.btnLoading = true
        this.$http.post(this.$http.defaults.trainingAPI + `api/trainingBusClass/remove`, para).then(response => {
          this.btnLoading = false
          if (response.data.success === true) {
            this.$message({
              message: '删除成功',
              type: 'success'
            })
          } else {
            console.log('删除失败:' + response.data.message)
            this.$message({
              message: '删除失败:' + response.data.message,
              type: 'error'
            })
          }
          this.getBatch()
        })
      })
    },
    tableresize (obj) {
      var clientHeight = 0
      if (document.body.clientHeight && document.documentElement.clientHeight) {
        clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      } else {
        clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      }
      obj.$nextTick(function () {
        obj.tableHeight = clientHeight - 232
      })
    },
    getDeptId () {
      // console.log('getDeptIdstart')
      let unitName = localStorage.getItem('unitName')
      // console.log(unitName)
      switch (unitName) {
        case '干部一处':
          this.deptId = 1
          this.deptIdName = '一'
          break
        case '干部二处':
          this.deptId = 2
          this.deptIdName = '二'
          break
        case '干部三处':
          this.deptId = 3
          this.deptIdName = '三'
          break
      }
      // console.log(this.deptId)
      if (this.deptId) {
        this.userType = 2
      }
      if (this.inRoles('ROLE_training')) {
        this.userType = 1
      }
      if (this.inRoles('ROLE_fusizhang')) {
        this.userType = 3
      }
      if (this.inRoles('ROLE_sizhang')) {
        this.userType = 4
      }
      // console.log(this.userType)
      // console.log(this.batch.status)
      // console.log(typeof this.userType)
      // console.log(typeof this.batch.status)
      if (this.userType === 2 && this.batch.status === 2) {
        this.officialCanEdit = false
        this.recommendedCanEdit = true
      } else if (this.userType === 1 && this.batch.status === 1) {
        this.officialCanEdit = true
        this.recommendedCanEdit = true
      } else if ((this.userType === 3 && this.batch.status === 3) || (this.userType === 4 && this.batch.status === 4)) {
        this.officialCanEdit = true
        this.recommendedCanEdit = false
      } else {
        this.officialCanEdit = false
        this.recommendedCanEdit = false
      }
      if (this.userType === 2) {
        this.classList = this.batch.classList.filter(item => item.departments && item.departments.split(',').indexOf(this.deptId.toString()) > -1)
      } else {
        this.classList = this.batch.classList
      }
      // console.log(this.filedCanEdit)
      // console.log(this.recommendedCanEdit)
    },
    getUser () {
      let para = {
        userType: 1
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsersByType`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user1list = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
      para = {
        userType: 4
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsersByType`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user4list = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
      para = {
        managedep: '干部培训处'
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsers002`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user3list = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
      para = {
        unitName: '干部一处',
        userType: 2
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsers001`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user2list1 = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
      para = {
        unitName: '干部二处',
        userType: 2
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsers001`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user2list2 = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
      para = {
        unitName: '干部三处',
        userType: 2
      }
      this.$http
        .post(this.$http.defaults.trainingAPI + `api/trainingBusAuth/getUsers001`, para)
        .then(response => {
          if (response.data.success === true) {
            this.user2list3 = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch((error) => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    deptConfirm () {
      this.deptConfirm1 = false
      this.deptConfirm2 = false
      this.deptConfirm3 = false
      if (this.batch.flowList) {
        this.batch.flowList.forEach(item => {
          if (this.user2list1.filter(it => it.id === item.sendUserId).length > 0) {
            this.deptConfirm1 = true
          }
          if (this.user2list2.filter(it => it.id === item.sendUserId).length > 0) {
            this.deptConfirm2 = true
          }
          if (this.user2list3.filter(it => it.id === item.sendUserId).length > 0) {
            this.deptConfirm3 = true
          }
        })
      }
    }
  },
  mounted () {
    this.myUnit = localStorage.getItem('unitName')
    this.getBatch()
    this.getUser()
    this.getOpinionList()
    this.tableresize(this)
    let _this = this
    window.onresize = function windowResize () {
      // 通过捕获系统的onresize事件触发我们需要执行的事件
      _this.tableresize(_this)
    }
  }
}
</script>
<style>
  #trainIndex .wboxd .el-table th{
    font-weight: normal;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
  }
  #trainIndex .wboxd .el-table td,
  #trainIndex .el-table th{
    padding:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体'
  }
  #trainIndex .tableth{
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    height:33px;
  }
  #trainIndex .wboxs{
    padding-top:10px;
  }
  #trainIndex .wboxd .el-table--border th,
  #trainIndex .el-table--border td {
    border-right: 1px solid #95B8E7;
  }
  #trainIndex .wboxd .el-table th.is-leaf,
  #trainIndex .el-table td {
    border-bottom: 1px solid #74A6CC !important;
    border-right: 1px solid #74A6CC !important;
  }
  #trainIndex .wboxd .el-table th.el-table__cell.is-leaf,
  #trainIndex .el-table td.el-table__cell {
    border-bottom: 1px solid #74A6CC !important;
  }
  #trainIndex .wboxd .el-table--border .el-table__cell{
    border-right: 1px solid #95B8E7 !important;
  }
  #trainIndex .wboxd .el-table td{
    border-right: 1px solid #95B8E7 !important;
    border-bottom: 1px solid #95B8E7 !important;
  }
  #trainIndex .mytable td{
    border-right: 1px solid #74A6CC !important;
    border-bottom: 1px solid #74A6CC !important;
  }
  #trainIndex .el-table{
    border-left: 1px solid #95B8E7 !important;
    border-top: 1px solid #95B8E7 !important;
    border-bottom: 1px solid #95B8E7 !important;
  }
  #trainIndex .el-table thead.is-group th.el-table__cell{
    border-right: 1px solid #95B8E7 !important;
    border-bottom: 1px solid #95B8E7 !important;
  }
</style>
<style scoped>
  #trainIndex h1{
    font-size:var(--size16) !important;
    font-weight: bolder;
    height: 30px;
    border-bottom: 1px solid #95B8E7;
    font-family: '宋体';
    line-height: 30px;
    color: #000;
    padding-left:10px;
    background-image: linear-gradient(to bottom , #EEF4FF, #E0ECFF);
    margin:0;
  }
  #trainIndex .el-pagination{
    float: left;
    padding:7px 10px;
  }
  #trainIndex .wboxs{
    padding:5px 15px;
    width: calc(100% - 30px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
  #trainIndex .wboxd{
    padding:0;
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
  #batchEditTable .el-upload--text{
    float:left !important;
  }
  #batchEditTable .el-upload__tip{
    float:left !important;
    margin-left:5px;
    margin-top:0 !important;
  }
  #batchEditTable .el-upload-list--text{
    padding-top:5px;
    clear: both !important;
  }
  #trainIndex .el-table{
    border-top: 1px solid #74A6CC !important;
  }
  #trainIndex .el-table--border th, .el-table--border td {
    border-right: 1px solid #74A6CC !important;
  }
  #trainIndex .el-table th.is-leaf, .el-table td {
    border-bottom: 1px solid #74A6CC !important;
  }
  #batchEditTable .mytable{
    border-top: 1px solid #74A6CC;
    border-left: 1px solid #74A6CC;
    margin: 10px;
    width: calc(100% - 20px);
    font-size:var(--size14) !important;
    font-family: '宋体'
  }
  #batchEditTable .mytable th,
  #batchEditTable .mytable td{
    height: auto;
    padding: 10px;
    border-right: 1px solid #74A6CC !important;
    border-bottom: 1px solid #74A6CC !important;
    vertical-align:top;
    line-height: 150%;
  }
  #batchEditTable .mytable th{
    background:#C0DCF1;
    width:150px;
    vertical-align: middle;
  }
  #trainIndex .pop-item {
    line-height: 35px;
    font-size:var(--size16) !important;
    word-break: break-all;
    border-bottom: 1px solid #eee;
    cursor: pointer;
  }
  #trainIndex .myFiles{
    background: url(../assets/meeting_icon_files.png) no-repeat;
    width: 30px;
    height:30px;
    cursor: pointer;
    margin:0 auto;
    background-size:100% 100%;
  }
</style>
